
import java.awt.image.BufferedImage;
import java.io.File;

import javax.imageio.ImageIO;

import model.CompositeCollisionMap;
import model.SimpleCollisionMap;;


public class Maiiin {

	public static void main(String[] args) {
		
		/*Image imageSource = java.awt.Toolkit.getDefaultToolkit().createImage("C:/Eclipse-workspace/TS2/data/image/test.png");
		
		File f = new File("C:/Eclipse-workspace/TS2/data/image/test.png");
		System.out.println(f.canRead());
		
		BufferedImage img = new BufferedImage(
                imageSource.getWidth(null),
                imageSource.getHeight(null),
                BufferedImage.TYPE_4BYTE_ABGR);
		Graphics2D g2d = img.createGraphics();
		
		g2d.drawImage(imageSource,0,0,null);*/
		try{
			BufferedImage img = ImageIO.read( new File("C:/Eclipse-workspace/TS2/data/image/test.png") );
			SimpleCollisionMap scm = new SimpleCollisionMap(img);
			SimpleCollisionMap scm2 = new SimpleCollisionMap(img);
			CompositeCollisionMap ccm = new CompositeCollisionMap();
			ccm.add(new int[2], scm);
			//ccm.add(new int[2], scm2);
			
			int [] position = new int[2];
			position[0]=51;
			position[1]=51;
			ccm.add(position, scm2);

			position[0]=52;
			position[1]=52;
			ccm.remove(position, scm);
			
			//ccm.remove(new int[2], scm);
			
			System.out.println("grid:\n"+ccm);
		}catch (Exception e) {
			// TODO: handle exception
		}

	}
	
}
